package com.lft.com.oilgas.controller;


import com.lft.com.oilgas.entity.Role;
import com.lft.com.oilgas.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.lft.com.oilgas.util.Result;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tyqw
 * @since 2024-09-10
 */
@RestController
@CrossOrigin
@RestControllerAdvice
@RequestMapping("/util/role")
public class RoleController {
    //处理异常
    @ExceptionHandler(Exception.class)
    private Result yichang(Exception e){
        //noinspection CallToPrintStackTrace
        e.printStackTrace();
        return new Result(false,"服务器异常，请稍后重试");
    }
    @Autowired
    private IRoleService iRoleService;
    @RequestMapping("/SelectRole")
    public Result CHAXUN(){
        List<Role> roles = iRoleService.selectleixing01();
        return  new Result(true,roles);


    }

}
